package com.biz;

import com.dao.UserinfoMapper;
import com.entity.Userinfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IUserInfoBizImp implements IUserInfoBiz {
    @Autowired
     UserinfoMapper dao;

    public UserinfoMapper getDao() {
        return dao;
    }

    public void setDao(UserinfoMapper dao) {
        this.dao = dao;
    }

    //登录
    @Override
    public Userinfo log(String uname, String pwd) {
        return dao.selectOne(uname,pwd);
    }

    //查询所有用户
    @Override
    public List getAll()
    {
        return dao.selectList();
    }

    @Override
    public void addUser(Userinfo userinfo) {
         dao.addUser(userinfo);
    }

    @Override
    public void modUser(Userinfo userinfo) {
        dao.modUser(userinfo);
    }

    @Override
    public void delUser(int id) {
        dao.delUser(id);
    }

    @Override
    public Userinfo selectById(int id) {
        return dao.selectById(id);
    }


}
